import type {BasicStatus, PermissionType} from "./enum";

export interface UserToken {
    token?: string;
}

export interface UserInfo {
    user_name: string;
    phone_number: string;
}


export interface CommonOptions {
    status?: BasicStatus;
    desc?: string;
    createdAt?: string;
    updatedAt?: string;
}

export interface User extends CommonOptions {
    id: string; // uuid
    username: string;
    password: string;
    email: string;
    phone?: string;
    avatar?: string;
}

export interface Role extends CommonOptions {
    id: string; // uuid
    name: string;
    code: string;
}

export interface Permission extends CommonOptions {
    id: string; // uuid
    name: string;
    code: string; // resource:action  example: "user-management:read"
}

export interface Menu extends CommonOptions {
    id: string; // uuid
    parentId: string;
    name: string;
    code: string;
    order?: number;
    type: PermissionType;
}


export type MenuTree = Menu & {
    children?: MenuTree[];
};
